import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import {
  SingleSheetComponent,
  MusicPlayComponent,
  PlayCountPipe,
  TimeFormatPipe,
  MusicSliderComponent,
  MusicSliderHandleComponent,
  MusicSliderTrackComponent,
  MusicPlayPanelComponent,
  PanelScrollComponent,
  SongService,
  LyricParseService,
  SongSheetService,
  ClickOutsideDirective,
  SongSheetListComponent,
  SingerService,
  MusicSearchComponent,
  MusicSearchService
} from './';

const COMPONENTS = [
  SingleSheetComponent,
  MusicPlayComponent,
  MusicSliderComponent,
  MusicSliderHandleComponent,
  MusicSliderTrackComponent,
  MusicPlayPanelComponent,
  PanelScrollComponent,
  SongSheetListComponent,
  MusicSearchComponent,
];

const PIPES = [
  PlayCountPipe,
  TimeFormatPipe
];

const SERVICES = [
  SongService,
  SongSheetService,
  LyricParseService,
  SingerService,
  MusicSearchService
];

@NgModule({
  declarations: [
    ClickOutsideDirective,
    ...COMPONENTS,
    ...PIPES,
  ],
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    RouterModule
  ],
  exports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    RouterModule,
    ClickOutsideDirective,
    ...COMPONENTS,
    ...PIPES,
  ],
  providers: [...SERVICES]
})
export class SharedModule { }
